package com.ygsoft.tianlu_mall.service.impl;

import com.ygsoft.tianlu_mall.mapper.ActDetailMapper;
import com.ygsoft.tianlu_mall.pojo.ActDetail;
import com.ygsoft.tianlu_mall.service.ActDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

@Service
public class ActDetailImpl implements ActDetailService {
    @Autowired
    ActDetailMapper actDetailMapper;
    @Override
    public void addDoRecharge(int user_id, BigDecimal recharge){
        HashMap<String,Object> map = new HashMap<>();
        map.put("user_id",user_id);
        map.put("recharge",recharge);
        map.put("time",new Date());
        actDetailMapper.addDoRecharge(map);
    }
    @Override
    public void doCash(int user_id,BigDecimal cash){
        HashMap<String,Object> map = new HashMap<>();
        map.put("user_id",user_id);
        map.put("cash",cash);
        map.put("time",new Date());
        actDetailMapper.doCash(map);
    }
    @Override
    public List<ActDetail> getDetail(int act_userid){return actDetailMapper.getDetail(act_userid);}
}
